<!--
 * @Author: lmk
 * @Date: 2021-11-29 17:54:26
 * @LastEditTime: 2021-12-10 18:59:34
 * @LastEditors: lmk
 * @Description: 
-->
<template>
	<!-- 开本资料 -->
	<view :class="currentTheme">
		<a-nabbar name="开本资料" />
		<view class="u-padding-left-32 u-padding-right-32">
			<view class="u-padding-bottom-20 u-padding-top-20">
				<item-search placeholder="搜索剧本" @change="downCallback" v-model="form.name"></item-search>
			</view>
			<mescroll-body @init="mescrollInit" @down="downCallback" @up="upCallback">
				<view v-for="(item,index) in dataList" :key="index" class="u-margin-bottom-20">
					<item-box padding="30">
						<view class="u-font-32 text-bold content-desc-item u-margin-bottom-30">{{item.name}}</view>
						<view class="u-flex"  v-if="item.type=='mall'">
							<view class="u-font-20 content-desc-item u-flex-1 ">
								{{item.folioData || '无'}}
							</view>
							<view class="u-font-20 u-padding-left-70 text-color-txtTheme" @click="copy(item)">
								复制链接 <u-icon name="lianjie" size="18" custom-prefix="index-custom-icon" color="#765CFE"></u-icon>
							</view>
						</view>
						<view class="u-flex" v-else>
							<view class="u-font-20 content-desc-item u-flex-1 ">
								{{item.folioData || '无'}}
							</view>
							<view class="u-font-20 u-padding-left-70 text-color-txtTheme" @click.stop="goIphone(item.folioData)">
		 					  拨打电话 <u-icon name="dianhua" size="18" custom-prefix="custom-icon" color="#765CFE"></u-icon>
							</view>
						</view>
					</item-box>
				</view>
			</mescroll-body>
		</view>
	</view>
</template>
<script>
	import upCallback from '@/mixins/upCallbackMixin.js'
	import itemSearch from '@/components/itemSearch/itemSearch.vue'
	export default {
		mixins: [upCallback],
		components: {
			itemSearch
		},
		data() {
			return {
				apiModule:"shopApi",
				apiType:'mallProduct',
				name:"queryFolioDataByUid",
				form:{
					name:""
				},
				readList:[{
					name:"xx",
					folioData:"xxx",
					type:'mall'
				},{
					name:"xx1",
					folioData:"18111657879",
					type:'experience'
				}]
			};
		},
		methods: {
			copy(val){
				uni.setClipboardData({
					data:val.folioData,
					success: () => {
						this.$u.toast('复制成功')
					},
					fail: () => {
						this.$u.toast('复制失败')
					}
				})
			},
			//拨打电话
			goIphone(iphone){
				if(!iphone) return false
				uni.makePhoneCall({
					phoneNumber: iphone
				})
			},
		},
	}
</script>

<style lang="scss">

</style>
